import { createApp } from 'vue'
import { createPinia } from 'pinia' // 导入createPinia函数
import piniaPluginPersistenstate from 'pinia-plugin-persistedstate' // 导入pinia-plugin-persist插件
import './style.css'
import '@unocss/reset/tailwind.css' // 选择你喜欢的重置样式
import 'virtual:uno.css' // UnoCSS 的虚拟 CSS 文件
import 'amfe-flexible'
import App from './App.vue'
import * as directives from '@/directive/derectiveall' // 导入自定义指令
import i18n from './i18n'
import DataVVue3 from '@kjgl77/datav-vue3'
import '@kjgl77/datav-vue3/dist/style.css'
const pinia = createPinia() // 创建Pinia实例
pinia.use(piniaPluginPersistenstate) // 安装pinia-plugin-persist插件
import router from './router' // 导入路由
const app = createApp(App)
// 全局注册所有指令
Object.keys(directives).forEach(key => {
    app.directive(key.replace('v', '').toLowerCase(), (directives as any)[key]);
});
app.use(pinia) // 将Pinia安装到Vue应用中
app.use(router) // 将路由安装到Vue应用中
app.use(i18n) // 注册 i18n 插件
app.use(DataVVue3)
app.mount('#app')